package com.sqlcheck.dto.response;

import com.sqlcheck.entity.ScanResult;
import com.sqlcheck.model.SqlStatement;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.Builder;

import java.time.LocalDateTime;
import java.util.List;

@Data
@Builder
@Schema(description = "手动SQL分析响应")
public class ManualSqlAnalysisResponse {

    @Schema(description = "分析是否成功", example = "true")
    private boolean success;

    @Schema(description = "错误信息，分析失败时返回", example = "SQL语法错误：缺少FROM子句")
    private String errorMessage;

    @Schema(description = "分析的SQL语句列表")
    private List<SqlStatement> sqlStatements;

    @Schema(description = "发现的兼容性问题列表")
    private List<ScanResult> issues;

    @Schema(description = "总问题数", example = "3")
    private Integer totalIssues;

    @Schema(description = "高严重程度问题数", example = "1")
    private Integer highSeverityCount;

    @Schema(description = "中等严重程度问题数", example = "1")
    private Integer mediumSeverityCount;

    @Schema(description = "低严重程度问题数", example = "1")
    private Integer lowSeverityCount;

    @Schema(description = "分析完成时间", example = "2023-12-01T10:30:00")
    private LocalDateTime analysisTime;

    @Schema(description = "保存的任务ID，如果保存了分析结果", example = "1")
    private Long savedTaskId;
}